package com.cjm.pattern.adapter.vthree;

import com.cjm.pattern.adapter.vonewihnopattern.LogFileOperate;
import com.cjm.pattern.adapter.vonewihnopattern.LogFileOperateApi;
import com.cjm.pattern.adapter.vonewihnopattern.LogModel;
import com.cjm.pattern.adapter.vtwonewinterface.LogDbOperateApi;

import java.util.ArrayList;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        LogModel logModel = new LogModel();
        logModel.setLogId("001");
        logModel.setOperatorTime("10-29");
        logModel.setOperatorUser("cjm");
        logModel.setContent("xxoo");

        List<LogModel> list = new ArrayList<>();
        list.add(logModel);

        LogFileOperateApi logFileOperateApi = new LogFileOperate("");

        LogDbOperateApi logDbOperateApi = new Adapter(logFileOperateApi);

        logDbOperateApi.createLog(logModel);

        List<LogModel> allLog = logDbOperateApi.getAllLog();
        System.err.println(allLog.get(0));

    }
}
